package com.example.kindergarten.services

import com.example.kindergarten.generator.mapper.KgUserMapper
import com.example.kindergarten.util.ResultResponse
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Repository
import org.springframework.stereotype.Service

@Repository
interface IHelloService {
    fun getUserById(id:String):ResultResponse
}

@Service
class HelloService:IHelloService {
    @Autowired
    lateinit var kgUserMapper: KgUserMapper

    override  fun getUserById(id:String): ResultResponse {
//        throw BizException(502,"这是一段错误")
        val user = kgUserMapper.selectById(id)
        println(user)
        return ResultResponse.success(user)
    }
}